import { sytRequest } from "@/request";
import React from "react";

// 获取医院设置列表
// GET /admin/hosp/hospitalSet/{page}/{limit}
export const getHospitalSet = async (page: number = 1, limit: number = 3, params: any) => {
    return await sytRequest.get(`/hosp/hospitalSet/${page}/${limit}`, { params })
}

// 添加医院的配置
// POST /admin/hosp/hospitalSet/save
export const postHospitalSave = async (body: any) => {
    return await sytRequest.post("/hosp/hospitalSet/save", body)
}


// 修改医院的配置PUT /admin/hosp/hospitalSet/update
export const putHospitalUpdate = async (body: any) => {
    return await sytRequest.put("/hosp/hospitalSet/update", body)
}

// 根据ID进行删除 DELETE /admin/hosp/hospitalSet/remove/{id}
export const deleteHospitalSet = async (id: number) => {
    return await sytRequest.delete(`/hosp/hospitalSet/remove/${id}`)
}

// DELETE /admin/hosp/hospitalSet/batchRemove
export const deleteHospitalSetBatchRemove = async (data: React.Key[]) => {
    return await sytRequest.delete("/hosp/hospitalSet/batchRemove", {
        data
    })
}
// GET /admin/hosp/hospitalSet/lock/{id}/{status}  更改状态（ status)
export const getLock = async (id: number, status: number) => {
    return await sytRequest.get(`/hosp/hospitalSet/lock/${id}/${status}`)
}


// 获取医院列表 GET /admin/hosp/hospital/{page}/{limit}
export const getHospital = async (page: number, limit: number, params: any) => {
    return await sytRequest.get(`/hosp/hospital/${page}/${limit}`, {
        params
    });
}

// GET 根据ID修改医院的上下线状态 /admin/hosp/hospital/updateStatus/{id}/{status}
export const getUpdateStatusById = async (id: number, status: number) => {
    return await sytRequest.get(`/hosp/hospital/updateStatus/${id}/${status}`)
}

// GET /admin/hosp/hospital/show/{id}
export const getHospitalShowById = async (id: string) => {
    return await sytRequest.get(`/hosp/hospital/show/${id}`)
}

// GET /admin/hosp/department/{hoscode}
export const getDepartmentByHoscode = async (hoscode: string) => {
    return await sytRequest.get(`/hosp/department/${hoscode}`)
}

// GET /admin/hosp/schedule/getScheduleRule/{page}/{limit}/{hoscode}/{depcode}
// 获取排班规则数据
export const getBookingScheduleList = async (page: number,limit:number,hoscode:string,depcode:string) => {
    return await sytRequest.get(`/hosp/schedule/getScheduleRule/${page}/${limit}/${hoscode}/${depcode}`)
}

// GET /admin/hosp/schedule/findScheduleList/{hoscode}/{depcode}/{workDate}获取workDate排班日期的排班详细列表
export const geScheduleList = async (hoscode:string,depcode:string,workDate:string) => {
    return await sytRequest.get(`/hosp/schedule/findScheduleList/${hoscode}/${depcode}/${workDate}`)
}
